package com.qinglei.recoup.system.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.qinglei.recoup.system.dao.IotLogMapper;
import com.qinglei.recoup.system.domain.IotLog;
import com.qinglei.recoup.system.service.IotLogService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * @author cxd
 */
@Service
public class IotLogServiceImpl extends ServiceImpl<IotLogMapper, IotLog> implements IotLogService {

    @Override
    public List<IotLog> selectIotLogByRequestId(String requestId) {
        if (StringUtils.isEmpty(requestId)) {
            return new ArrayList<>();
        }
        return baseMapper.selectList(new QueryWrapper<IotLog>().lambda().in(IotLog::getRequestId, requestId));
    }
}
